@model WalkingTec.Mvvm.Mvc.Admin.ViewModels.FrameworkGroupVMs.FrameworkGroupMDVM
@using Microsoft.Extensions.Localization;
@inject IStringLocalizer<Program> Localizer;

<wt:form vm="@Model">
  @for (int i = 0; i < Model.DpLists.Count; i++)
  {
    <wt:hidden field="DpLists[i].List.Searcher.TableName" />
    <wt:combobox multi-select="false" field="DpLists[i].IsAll" yes-text="@Localizer["_Admin.AllPris"]" no-text="@Localizer["_Admin.SelectPris"]" empty-text="@Localizer["_Admin.NoPris"]" label-text="@Model.DpLists[i].DpName" change-func="IsAllChange@(i)" />
    <wt:row id="selector@(i)">
      <wt:selector list-vm="DpLists[i].List" field="DpLists[i].SelectedIds" text-bind="DpLists[i].List.EntityList[0].Name" val-bind="DpLists[i].List.EntityList[0].ID" label-text="">
        <wt:searchpanel vm="DpLists[i].List">
          <wt:row items-per-row=" ItemsPerRowEnum.Two">
            <wt:textbox field="DpLists[i].List.Searcher.Filter" />
          </wt:row>
        </wt:searchpanel>
      </wt:selector>
    </wt:row>

    <script>
            IsAllChange@(i)({ value: '@Model.DpLists[i].IsAll.ToString().ToLower()' });
            function IsAllChange@(i)(data) {
                if (data.value == 'true' || data.value == '') {
                    $('#selector@(i)').css('display', 'none');
                }
                else {
                    $('#selector@(i)').css('display', 'block');
                }
            }

    </script>
  }

  <wt:hidden field="GroupCode" />
  <wt:row align="AlignEnum.Right">
    <wt:submitbutton />
    <wt:closebutton />
  </wt:row>
</wt:form>

<!-- WTM默认页面 Wtm buidin page-->
